import jsonToMap from '../j2m.js'
import data from '../data/LangPackageTableCnData.json'

const txt = jsonToMap(data)

export const getText = function (textId) {
  return txt.get(textId) || ''
}, getParsedText = function (textId) {
  const text = txt.get(textId)
  return text ? text.replace(/<color=(#?\w+)>(.*?)<\/color>/gi, '<span style="color:$1;">$2</span>').replaceAll('\n', '<br>') : ''
}